﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IceBird;
//这个文件里面是data对象的数据结构 如果想到需要存储其他信息可以添加 一般不用改

namespace WinFormClient
{
    [Serializable]
    public class ClientData
    {
        public UserInfo userinfo = new UserInfo("","");
        public Dictionary<int, string> focusedTopics;//简易版的存储<int id, string title>
        public Dictionary<int, string> focusedGroups;//同上
        public Dictionary<int, string> userID2name;
        public ClientData() { userID2name = new Dictionary<int, string>(); }
        //public GroupSet dataTree;//实验一下用这个能不能用树形存储所有数据
                                                  // 包括groups topics msgs ... 一期可以先不往这个里存东西
    }

    [Serializable]
    public class UserInfo
    {
        string username;
        public string UserName
        {
            get { return username; }
            set { username = value; }
        }
        string password;

        public string Password
        {
            get { return password; }
            set { password = value; }
        }

        public UserInfo(string a, string b){this.UserName = a; this.Password = b;}
        int userid;

        public int UserID
        {
            get { return userid; }
            set { userid = value; }
        }

        /*public User ToUser()
        {
            User u =  new User();
            u.UserName = this.UserName;
            u.Password = this.Password;
            return u;
        }*/
    }

    /*
    public class User : UserInfo
    {       
        int userid;

        public int UserID
        {
            get { return userid; }
            set { userid = value; }
        }
        
        LoginState state;

        public LoginState State
        {
            get { return state; }
            set { state = value; }
        }

    }*/
}
